  
    /**
    *  Check to see if fields must contain a value only if the attribute match with the action parameter.
    * Fields are not checked if they are disabled.
    * <p>
    * Required javascript: createCampos, hasAtribute
    * @param form The form validation is taking place on.
    */

     /**
     * ValidateRequiridIfAtribute
     */
    function validateRequiredIfAtribute(form) {
    
        var isValid = true;
        var focusField = null;
        var i = 0;
        var fields = new Array();
        var formName = form.getAttributeNode("name");

        oRequired = eval('new ' + formName.value + '_requiredIfAtribute()');

        for (x in oRequired) {
            var field = form[oRequired[x][0]];
            var mens=oRequired[x][1];
            
            
            if(hasAtribute(oRequired[x][2]("atribute"), oRequired[x][2]("atributeValue"), form.action, form, field)){
                var valores = createCampos(field);
                var notValue = oRequired[x][2]("atributeNotValue");
                if (testValues(notValue, valores)){
                    var f = firstField(field);
                    if (i == 0) {
                        focusField = f;
                    }
                    fields[i++] = mens;
                    isValid = false;
                }
            }
        }
                
        if (fields.length > 0) {
           setFocus(focusField);
           alerte(fields);
        }
        return isValid;
    }